package com.xiaotao.controller;

import com.xiaotao.entity.User;
import com.xiaotao.service.UserService;
import com.xiaotao.util.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    private UserService userService;
    @PostMapping("login")
    public Result login(@RequestBody User user) throws Exception {
        return userService.login(user);
    }
}
